/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
    /**
     * built-in config
     * @type {Egg.EggAppConfig}
     **/
    const config = exports = {};

    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + '_1614405091527_4163';

    // add your middleware config here
    config.middleware = ['errorHandler', 'jwt'];

    config.cors = {
        origin: '*',
        allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'
    }
    config.tencent = {
        SecretId: 'AKIDKSJ6vW97AzZkjgvxFNL4YnzwfAarnWuC',
        SecretKey: 'DAsQoCDD3kCTXPkvqeFenhQvEHI6k9IG',
        bucket: 'feng-1300275634',
        region: 'ap-chengdu'
    };
    config.sequelize = {
        dialect: 'mysql',
        host: '47.108.156.205',
        port: 3306,
        database: 'chat',
        username: 'root', //数据库用户名
        password: '123456' //数据库密码
    }

    config.security = {
        csrf: {
            enable: false,
            ignoreJSON: true
        },
        domainWhiteList: ['*']
    }

    config.jwt = {
        secret: 'egg-api-jwt'
    }

    // add your user config here
    const userConfig = {
        // myAppName: 'egg',
    };

    return {
        ...config,
        ...userConfig,
    };
};